home *** CD-ROM | disk | FTP | other *** search
/ MacTech 1 to 12 / MacTech-vol-1-12.toast / Source / MacTech® Magazine / Volume 06 - 1990 / 06.09 Sep 90 / Object1 Folder / CShape.h < prev    next >
Encoding:
C/C++ Source or Header  |  1990-01-11  |  792 b   |  40 lines  |  [TEXT/KAHL]

  1. /*
  2.  *    Source    - CShape.h
  3.  *    Author    - Mark Bykerk Kauffman
  4.  *    Purpose    - To define a small class of shapes using THINK C, and to illustrate
  5.  *              several key concepts of object oriented programming.  All of these
  6.  *              classes use the convention of having a C as the first letter their
  7.  *            class name.
  8.  */
  9.                       
  10. struct CShape : indirect            
  11. {
  12.     Rect    Location;
  13.     
  14.     void SetShapeLoc(int A, int B,int C,int D);
  15.     void Draw(void);
  16.     void Erase(void);
  17. };
  18.  
  19. /*
  20.  * All of the following classes are descendants of CShape.  They inherit all
  21.  * of CShapes methods and instance variables.
  22.  */
  23.    
  24. struct COval : CShape
  25. {
  26.     void Draw(void);
  27.     void Erase(void);
  28. };
  29.  
  30. struct CRectangle : CShape
  31. {
  32.     void Draw(void);
  33.     void Erase(void);
  34. };
  35.  
  36. struct CLine : CShape
  37. {
  38.     void Draw(void);
  39.     void Erase(void);
  40. };